Global Index
HTML5 JS API Index > SVG Tutorials & Specs

SVGPaint

Extends SVGColor.

Properties
const unsigned short
SVG_PAINTTYPE_CURRENTCOLOR = 102
Corresponds to a currentColor value on a <paint> specification.
const unsigned short
SVG_PAINTTYPE_NONE = 101
Corresponds to a none value on a <paint> specification.
const unsigned short
SVG_PAINTTYPE_RGBCOLOR = 1
An sRGB color has been specified without an alternative ICC color specification.
const unsigned short
SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2
An sRGB color has been specified along with an alternative ICC color specification.
const unsigned short
SVG_PAINTTYPE_UNKNOWN = 0
The paint type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
const unsigned short
SVG_PAINTTYPE_URI = 107
Only a URI has been specified.
const unsigned short
SVG_PAINTTYPE_URI_CURRENTCOLOR = 104
A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.
const unsigned short
SVG_PAINTTYPE_URI_NONE = 103
A URI has been specified, along with an explicit none as the backup paint method in case the URI is unavailable or invalid.
const unsigned short
SVG_PAINTTYPE_URI_RGBCOLOR = 105
A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.
const unsigned short
SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106
A URI has been specified, along with both an sRGB color and alternate ICC color as the backup paint method in case the URI is unavailable or invalid.
unsigned short
paintType
The type of paint, identified by one of the SVG_PAINTTYPE_* constants defined on this interface.
DOMString
uri
When the paintType specifies a URI, this attribute holds the URI string. When the paintType does not specify a URI, this attribute is null.
Operations
void
setPaint(unsigned short paintType, DOMString uri, DOMString rgbColor, DOMString iccColor)
Sets the paint as specified by the parameters. If paintType requires a URI, then uri must be non-null; otherwise, uri must be null. If paintType requires an RGBColor, then rgbColor must be a string that matches <color>; otherwise, rgbColor must be null.
void
setUri(DOMString uri)
Sets the paintType to SVG_PAINTTYPE_URI_NONE and sets uri to the specified value. ParametersDOMString uri The URI for the desired paint server.